home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / HYPERCAR / BUTTONS_ / COOL_BUT.TON / card_4042.txt < prev    next >
Text File  |  1988-03-23  |  5KB  |  246 lines

  1. -- card: 4042 from stack: in.TON
  2. -- bmap block id: 2790
  3. -- flags: 0000
  4. -- background id: 3537
  5. -- name: 
  6.  
  7.  
  8. -- part 2 (button)
  9. -- low flags: 00
  10. -- high flags: A004
  11. -- rect: left=400 top=314 right=336 bottom=501
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 21
  16. -- text size: 10
  17. -- style flags: 0
  18. -- line height: 13
  19. -- part name: Spiral2
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   put the userLevel into saveLevel
  23.   set userLevel to 3
  24.  
  25.   ask "Which tool?" with "oval tool"
  26.   put it into ThisTool
  27.   choose ThisTool
  28.  
  29.   set multiple to true
  30.   set centered to false
  31.   domenu "select all"
  32.   domenu "clear picture"
  33.  
  34.   put 250 into xcenter
  35.   put 180 into ycenter
  36.   put 100 into radius
  37.   put xcenter into lastx
  38.   put ycenter - radius into lasty
  39.   put 100 into numbsegs
  40.   put 0 into angle
  41.  
  42.   repeat until radius is 0
  43.     put xcenter + round (radius * sin (angle)) into x
  44.     put ycenter - round (radius * cos (angle)) into y
  45.     drag from lastx, lasty to x, y
  46.     put x into lastx
  47.     put y into lasty
  48.     add (2 * pi * 1 / numbsegs) to angle
  49.     subtract 1/2 from radius
  50.   end repeat
  51.   Choose browse tool
  52.   set userlevel to savelevel
  53. end mouseUp
  54.  
  55.  
  56. -- part 3 (button)
  57. -- low flags: 00
  58. -- high flags: A004
  59. -- rect: left=400 top=290 right=312 bottom=501
  60. -- title width / last selected line: 0
  61. -- icon id / first selected line: 0 / 0
  62. -- text alignment: 1
  63. -- font id: 21
  64. -- text size: 10
  65. -- style flags: 0
  66. -- line height: 13
  67. -- part name: Spiral
  68. ----- HyperTalk script -----
  69. on mouseUp
  70.   put the userLevel into saveLevel
  71.   set userLevel to 3
  72.  
  73.   choose brush tool
  74.   set brush to random(32)
  75.  
  76.   domenu "select all"
  77.   domenu "clear picture"
  78.   put 250 into xcenter
  79.   put 180 into ycenter
  80.   put 100 into radius
  81.   put xcenter into lastx
  82.   put ycenter - radius into lasty
  83.   put 50 into numbsegs
  84.   put 0 into angle
  85.  
  86.   repeat until radius is 0
  87.     put xcenter + round (radius * sin (angle)) into x
  88.     put ycenter - round (radius * cos (angle)) into y
  89.     drag from lastx,lasty to x, y
  90.     put x into lastx
  91.     put y into lasty
  92.     add (2 * pi * 1 / numbsegs) to angle
  93.     subtract 1/2 from radius
  94.   end repeat
  95.   choose browse tool
  96.   set userlevel to savelevel
  97. end mouseUp
  98.  
  99.  
  100. -- part 6 (button)
  101. -- low flags: 00
  102. -- high flags: A004
  103. -- rect: left=400 top=265 right=288 bottom=501
  104. -- title width / last selected line: 0
  105. -- icon id / first selected line: 0 / 0
  106. -- text alignment: 1
  107. -- font id: 3
  108. -- text size: 10
  109. -- style flags: 0
  110. -- line height: 13
  111. -- part name: Multi lines
  112. ----- HyperTalk script -----
  113. on mouseUp
  114.   put the userLevel into saveLevel
  115.   set userLevel to 3
  116.   choose line tool
  117.   domenu "select all"
  118.   domenu "clear picture"
  119.  
  120.   ask "what origin?" with "0,0"
  121.   put it into Origin
  122.  
  123.   ask "what increments?" with 5
  124.   put it into Incr
  125.   put 0 into Yval
  126.   put 512 into xval
  127.  
  128.   repeat until Yval>348
  129.     drag from Origin to 512,yval
  130.     add Incr to Yval
  131.   end repeat
  132.   Choose browse tool
  133.   set userlevel to savelevel
  134. end mouseUp
  135.  
  136.  
  137. -- part 7 (button)
  138. -- low flags: 00
  139. -- high flags: A004
  140. -- rect: left=400 top=241 right=263 bottom=501
  141. -- title width / last selected line: 0
  142. -- icon id / first selected line: 0 / 0
  143. -- text alignment: 1
  144. -- font id: 3
  145. -- text size: 10
  146. -- style flags: 0
  147. -- line height: 13
  148. -- part name: Hyperbole
  149. ----- HyperTalk script -----
  150. on mouseUp
  151.   put the userLevel into saveLevel
  152.   set userLevel to 3
  153.  
  154.   choose line tool
  155.   domenu "select all"
  156.   domenu "clear picture"
  157.   set centered to false
  158.   set grid to false
  159.  
  160.   put 25 into x1
  161.   put 25 into y1
  162.   put 25 into y2
  163.   put 500 into x2
  164.  
  165.   ask "what increments?" with 10
  166.   put it into Incr
  167.  
  168.   repeat until x2 < y2
  169.     drag from x1,y1 to x2,y2
  170.     add Incr to y1
  171.     subtract incr from x2
  172.   end repeat
  173.   choose browse tool
  174.   set userlevel to savelevel
  175. end mouseUp
  176.  
  177.  
  178. -- part 9 (button)
  179. -- low flags: 00
  180. -- high flags: A004
  181. -- rect: left=400 top=216 right=239 bottom=501
  182. -- title width / last selected line: 0
  183. -- icon id / first selected line: 0 / 0
  184. -- text alignment: 1
  185. -- font id: 21
  186. -- text size: 10
  187. -- style flags: 0
  188. -- line height: 13
  189. -- part name: Multi shapes
  190. ----- HyperTalk script -----
  191. on mouseUp
  192.   put the userLevel into saveLevel
  193.   set userLevel to 3
  194.  
  195.   answer "Draw shape with what tool?" with "line" or "Reg. polygon" or "Oval"
  196.   if it is "line" then choose line tool
  197.   if it is "oval" then choose Oval tool
  198.   if it is "reg. polygon" then
  199.     choose regular polygon tool
  200.     set polysides to random(6) +2
  201.   end if
  202.  
  203.   ask "Radius? (in pixels)" with "112"
  204.   if it is "cancel" then exit mouseup
  205.   put it into Radius
  206.  
  207.   ask "Increments?" with "8"
  208.   if it is "cancel" then exit mouseup
  209.   put it into incr
  210.  
  211.   --              -- Make the radius evenly divisible by Increments
  212.   put trunc(radius/incr) * incr into Radius
  213.  
  214.   domenu "select all"
  215.   domenu "clear picture"
  216.   set centered to true
  217.   set grid to false
  218.  
  219.   put 250 into h1   --         the center h and v points
  220.   put 200 into v1
  221.  
  222.   put h1-radius into h2   --   the first side's first end point
  223.   put 200 into v2
  224.  
  225.   repeat while abs(v2-v1) <= abs(h2-h1)
  226.     drag from  h1,v1 to h2,v2
  227.     subtract incr from v2
  228.   end repeat
  229.  
  230.   put 250 into h2  --          the second side's first end point
  231.   put v1-radius into v2
  232.  
  233.   repeat while abs(h2-h1) <= abs(v2-v1)
  234.     drag from h1,v1 to h2,v2
  235.     add incr to h2
  236.   end repeat
  237.   choose browse tool
  238.   set userLevel to saveLevel
  239. end mouseUp
  240.  
  241.  
  242.  
  243.  
  244. -- part contents for background part 1
  245. ----- text -----
  246. Painting buttons